var verify_sams_club_overlapping_date_different_price_baseMsg = JSON.parse('{"CODE":0, "ACTION":"","LEVEL":"T1", "MSG":"","DATA":"","SCRIPTNAME":"verify_sams_club_overlapping_date_different_price"}');

if (!isNull(request_sku_list)) {
    var data = JSON.parse(request_sku_list);
    for (var i = 0; i < data.length; i++) {
        var obj = data[i];

        if (isNull(obj.cost_end_date) && isNull(cost_end_date)) {
            // 两个对比的成本结束时间如果是永久 直接跳过
            continue;
        }

        if (!isNull(obj.cost) && !isNull(cost) && obj.cost == cost) {
            // 两个对比的 未税成本如果相等 直接跳过
            continue;
        }

        // 判断交叉门店
        if (!determineInterSectionStore(obj, id, item_nbr, trait_nbr, store_id, trait_store, store_type, false, store_jd)) {
            continue;
        }

        var d1 = getNewDate(new Date(obj.cost_start_date));
        var d2 = isNull(obj.cost_end_date) ? getNewDate(new Date("2049-12-31")) : getNewDate(new Date(obj.cost_end_date))
        var d3 = getNewDate(new Date(cost_start_date));
        var d4 = isNull(cost_end_date) ? getNewDate(new Date("2049-12-31")) : getNewDate(new Date(cost_end_date))

        // 判断交叉时间
        var overlapsFlag = overlaps(d1, d2, d3, d4);

        // 判断首尾相连
        var head = getAfterDate(d2, 1) == d3 || getAfterDate(d4, 1) == d1;

        if (overlapsFlag || head) {
            verify_sams_club_overlapping_date_different_price_baseMsg.CODE = 2;
            verify_sams_club_overlapping_date_different_price_baseMsg.ACTION = 'error';
            verify_sams_club_overlapping_date_different_price_baseMsg.MSG = '同门店存在2个交叉时间或首尾相连的不同成本';
        }
    }
}
JSON.stringify(verify_sams_club_overlapping_date_different_price_baseMsg);